import { Sequelize } from "sequelize"
// import { Blog } from "../model/Blog"

export const sequelize = new Sequelize({
    dialect:'sqlite',
    storage:'./db.db'
})

export const sync = async()=>{
    let { Blog } = await import('../model/Blog.js')
    await sequelize.sync({ force: true })
    let arr =[
        {
            title:'1122',
            author:'chen'
        },
        {
            title:'1122',
            author:'chen'
        },
        {
            title:'1122',
            author:'chen'
        },
        {
            title:'1122',
            author:'chen'
        },
        {
            title:'1122',
            author:'chen'
        },
        {
            title:'1122',
            author:'chen'
        },
    ]
     Blog.bulkCreate(arr)//批量初始化数据bulkCreate
}
